package com.situ.ftbserver.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.situ.ftbserver.model.Reserve;
import com.situ.ftbserver.model.search.ReserveSearchBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

@Mapper
public interface ReserveMapper extends BaseMapper<Reserve> {


    List<Reserve> findAll(ReserveSearchBean rsb);

    @Select("SELECT course.`name`,COUNT(member_id) as 'value' FROM reserve LEFT JOIN course on reserve.course_id=course.id GROUP BY course_id limit 15")
     List<Map<String, Integer>> getCourseReserveCount();


}
